/**
 * [BASE_URL_XJ description]
 * 用户中心 UrlConfig
 */
import VueCookie from 'vue-cookie'
// var token = VueCookie.get('token');

const getUrlKey = (name) => {
  return decodeURIComponent((new RegExp('[?|&]' + name + '=' +
    '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(
    /\+/g, '%20')) || null;
}

var token = getUrlKey('token');

var re =
  /^([\w-]+\.)+((com)|(net)|(org)|(gov\.cn)|(info)|(cc)|(com\.cn)|(net\.cn)|(org\.cn)|(name)|(biz)|(tv)|(cn)|(mobi)|(name)|(sh)|(ac)|   (io)|(tw)|(com\.tw)|(hk)|(com\.hk)|(ws)|(travel)|(us)|(tm)|(la)|(me\.uk)|(org\.uk)|(ltd\.uk)|(plc\.uk)|(in)|(eu)|(it)|(jp))$/;



let hostname = window.location.hostname,
    hostPart = window.location.port,
    SCHEDULE_URL = 'http://47.96.164.92:8080'; //测试地址
    // SCHEDULE_URL = 'http://120.92.9.250:8081'; //正式地址
    // SCHEDULE_URL = 'http://172.31.100.37:8080'; //本地地址

  
  // SCHEDULE_URL = 'http://120.92.9.250:8080';

  // DEV_URL = 'http://dev.tchenedu.cn', //测试服
  // DEV_URL = 'http://172.31.100.37:8086'; //本地
const UrlConfig = {

  TeacherList: SCHEDULE_URL + '/course/rule/getTeacherList.do?token=' + token, //通知消息列表
	getClassList: SCHEDULE_URL + '/course/rule/getClassList.do?token=' + token, //获取班级列表
  getCourseList: SCHEDULE_URL + 'course/rule/getCourseList.do?token=' + token, //获取课程表



  // 排课规则设置
  CheckComplete: SCHEDULE_URL + '/course/schedule/checkInfoIsPerfect.do?token=' + token, //不可连堂节次
  //不连堂
  GapRule: SCHEDULE_URL + '/course/rule/getGapRule.do?token=' + token, //不可连堂节次
  AddGapRule: SCHEDULE_URL + '/course/rule/addOrUpdateGapRule.do?token=' + token, //修改不可连堂节次
  AddGapRule: SCHEDULE_URL + '/course/rule/addOrUpdateGapRule.do?token=' + token, //修改不可连堂节次
  LinkList: SCHEDULE_URL + '/course/rule/getLinkList.do?token=' + token, //必须连堂的科目信息
  // 合班
  GetQueryCourse:  SCHEDULE_URL + '/course/rule/getCourseList.do?token=' + token, //课程信息
  GetClassDtoByCourse: SCHEDULE_URL + '/course/rule/getClassDtoByCourse.do?token=' + token, //查询合班信息
  AddMergeInfo: SCHEDULE_URL + '/course/rule/addMergeInfo.do?token=' + token, //增加合班信息
  GetMergeInfo: SCHEDULE_URL + '/course/rule/getMergeInfo.do?token=' + token, //查询合班结果
  DeleteMergeInfo: SCHEDULE_URL + '/course/rule/deleteMergeInfo.do?token=' + token, //删除合班数据
  GetJaqpByCourseId: SCHEDULE_URL + '/course/rule/getJaqpByCourseId.do?token=' + token, //查询教案齐平table
  updateJaqpById: SCHEDULE_URL + '/course/rule/updateJaqpById.do?token=' + token, //保存教案齐平
  GetWeekByCourseId: SCHEDULE_URL + '/course/rule/selectWeekByCourseId.do?token=' + token, //查询周任课规则
  updateWeekById: SCHEDULE_URL + '/course/rule/updateWeekById.do?token=' + token, //保存周任课规则
  getDayByCourseId: SCHEDULE_URL + '/course/rule/getDayByCourseId.do?token=' + token, //查询日任课规则
  updateDayById: SCHEDULE_URL + '/course/rule/updateDayById.do?token=' + token, //保存日任课规则
  GetDayConByCourseId: SCHEDULE_URL + '/course/rule/selectDayConByCourseId.do?token=' + token, //查询连上规则
  updateDayConByCourseId: SCHEDULE_URL + '/course/rule/updateDayConById.do?token=' + token, //保存连上规则
  //不排课时间
  RuleGetClassList: SCHEDULE_URL + '/course/rule/getClassList.do?token=' + token, //班级集合
  RuleTeacherCourseList: SCHEDULE_URL + '/course/rule/teacherCourseList.do?token=' + token, //教师所教课程集合
  RulegetTeacherList: SCHEDULE_URL + '/course/rule/getTeacherList.do?token=' + token, //教师集合
  RuleGetCourseList: SCHEDULE_URL + '/course/rule/getCourseList.do?token=' + token, //课程集合
  RuleGetRule: SCHEDULE_URL + '/course/rule/getRule.do?token=' + token, //获取不排课表格
  RuleUpdateRule: SCHEDULE_URL + '/course/rule/addOrUpdateRule.do?token=' + token, //更新不排课表格



	//ZY
	queryScheduleTask: SCHEDULE_URL + '/course/schedule/queryScheduleTask.do?token=' + token, //获取课程表



	queryGradeInfo: SCHEDULE_URL + '/course/schedule/queryGradeInfo.do?token=' + token,//获取年级信息
	deleteScheduleTask: SCHEDULE_URL+'/course/schedule/deleteScheduleTask.do?token=' + token,//删除课程表
	saveScheduleTask: SCHEDULE_URL+'/course/schedule/saveScheduleTask.do?token=' + token,//添加课程表
	trigger: SCHEDULE_URL + '/course/schedule/trigger.do?token=' + token,//一键排课
	reload: SCHEDULE_URL + '/course/schedule/trigger/reload.do?token='+token, //重新排课
	judgeState: SCHEDULE_URL + '/course/schedule/state.do?token=' + token, //排课状态查询
	findDesc: SCHEDULE_URL + '/course/schedule/error/desc.do?token=' + token, //查找违反规则
	findRule: SCHEDULE_URL + '/course/schedule/pliable/rule.do?token=' + token, //查找违反规则
	getTeacherList: SCHEDULE_URL + '/course/rule/getTeacherList.do?token=' + token, //根据任务ID和科目查找教师
	Website: SCHEDULE_URL+'/course/schedule/', //获取课表和导出

	getRoomCourse: SCHEDULE_URL + '/course/schedule/room/course/result.do?token=' + token,//
	getClassCourse: SCHEDULE_URL + '/course/schedule/class/course/result.do?token=' + token,//
	getStudentCourse: SCHEDULE_URL + '/course/schedule/student/course/result.do?token=' + token,//
	getTeacherCourse: SCHEDULE_URL + '/course/schedule/teacher/course/result.do?token=' + token,//
	getAllCourse: SCHEDULE_URL + '/course/schedule/all/course/result.do?token=' + token,//


	exportAll: SCHEDULE_URL +'/course/schedule/all/course/export.do?token=' + token,//
	exportTeacher: SCHEDULE_URL +'/course/schedule/teacher/course/export.do?token=' + token,//
	exportStudent: SCHEDULE_URL +'/course/schedule/student/course/export.do?token=' + token,//
	exportClass: SCHEDULE_URL +'/course/schedule/class/course/export.do?token=' + token,//
	exportRoom: SCHEDULE_URL +'/course/schedule/room/course/export.do?token=' + token,//

	queryRoom: SCHEDULE_URL+'/course/schedule/queryRoom.do?token=' + token, //获取教室集合
	queryStudent: SCHEDULE_URL+'/course/schedule/queryStudent.do?token=' + token,//获取学生接口
	updateScheduleTask: SCHEDULE_URL+'/course/schedule/updateScheduleTask.do?token=' + token,//修改年级信息

	queryScheduleTaskStatus: SCHEDULE_URL+'/course/schedule/queryScheduleTaskStatus.do?token='+token, //查询任务状态

  //调课
  getTeacherList2: SCHEDULE_URL + '/course/schedule/queryTeacher.do?token=' + token, //根据任务ID和科目查找教师
  getResultByRoom: SCHEDULE_URL+'/course/schedule/room/course/result.do?token=' + token,//根据room获取课表
  getResultByTeacher: SCHEDULE_URL+'/course/schedule/teacher/course/result.do?token=' + token,//根据teacher获取课表
  queryStatusByClassCoord: SCHEDULE_URL+'/course/schedule/class/queryStatusByCoord.do?token=' + token,//根据坐标获取行政班调课状态
  queryStatusByTeacherCoord: SCHEDULE_URL+'/course/schedule/teacher/queryStatusByCoord.do?token=' + token,//根据坐标获取行政班调课状态teacher
  queryEduStatusByClassCoord: SCHEDULE_URL+'/course/schedule/edu/room/queryStatusByCoord.do?token=' + token,//根据坐标获取教学班调课状态
  result: SCHEDULE_URL+'/course/schedule/adjustment/schedule/result.do?token=' + token,//获取行政班调课结果查询
  success: SCHEDULE_URL+'/course/schedule/adjustment/success.do?token=' + token,//获取行政班调课结果查询
  exchangeByClass: SCHEDULE_URL+'/course/schedule/class/exchange.do?token=' + token,//班级调课class
  exchangeByTeacher: SCHEDULE_URL+'/course/schedule/teacher/exchange.do?token=' + token,//班级调课Teacher
  queryCurrTimeCourse: SCHEDULE_URL+'/course/schedule/teacher/teach/queryCurrTimeCourse.do?token=' + token,//获取所教室的课程信息
  queryCurrTimeCourse2: SCHEDULE_URL+'/course/schedule/teacher/teach/queryCurrTimeCourse2.do?token=' + token,//获取所教室的课程信息
  queryEduStatusByTeacherCoord: SCHEDULE_URL+'/course/schedule/edu/teacher/queryStatusByCoord.do?token=' + token,//调用评价算法
  exchangeByTeacherTeach: SCHEDULE_URL+'/course/schedule/teacher/teach/exchange.do?token=' + token,//教学班调课Teacher
  queryClassByCoord: SCHEDULE_URL+'/course/schedule/teacher/queryClassByCoord.do?token=' + token,//行政班教师课表新增接口
  getDesc: SCHEDULE_URL+'/course/schedule/adjustment/error/desc.do?token=' + token,//获取异常描述

	  getTokenValue:'http://dev.tchenedu.cn/weChat/user/getTokenValue?token=' + token, //获取ID测试环境
		// getTokenValue:'http://service.tchenedu.cn/weChat/user/getTokenValue?token=' + token, //获取ID正式环境

  //基础信息设置
  getGradeYearInfo: SCHEDULE_URL + '/course/grade/getGradeYearInfo.do?token=' + token,
  saveOrUpdateCourseHour: SCHEDULE_URL + '/course/schedule/saveOrUpdateCourseHour.do?token=' + token,    //保存教学时间信息(全部)
  queryTeachTime: SCHEDULE_URL + '/course/schedule/queryTeachTime.do?token=' + token,   //查询教学时间
  saveTeachTime: SCHEDULE_URL + '/course/schedule/saveTeachTime.do?token=' + token,    //保存教学时间信息
  queryCourseInfoByTaskId: SCHEDULE_URL + '/course/schedule/queryCourseInfoByTaskId.do?token=' + token, //获取课程信息
  saveOrUpdateCourseTime: SCHEDULE_URL + '/course/schedule/saveOrUpdateCourseTime.do?token=' + token, //添加或修改课程课时信息
  queryTeacherByTaskId: SCHEDULE_URL + '/course/schedule/queryTeacherByTaskId.do?token=' + token, // 获取教师信息
  saveTeacherSchedule: SCHEDULE_URL + '/course/schedule/saveTeacherSchedule.do?token=' + token,  //保存教师配置信息
  getConfigRooms: SCHEDULE_URL + '/course/schedule/getConfigRooms.do?token=' + token,  //获取教室设置信息
  updateClassRoom: SCHEDULE_URL + '/course/schedule/updateClassRoom.do?token=' + token,  //修改教室信息
  
  // 教室任课限制
  getBaseRuleInfo: SCHEDULE_URL + '/course/rule/getBaseRuleInfo.do?token=' + token,  // 获取基本规则信息
  saveBaseRuleInfo: SCHEDULE_URL + '/course/rule/saveBaseRuleInfo.do?token=' + token,  // 保存基本规则信息
  saveTeacherRepellentInfo: SCHEDULE_URL + '/course/rule/saveTeacherRepellentInfo.do?token=' + token,  // 保存互斥老师信息
  getTeacherInfo: SCHEDULE_URL + '/course/rule/getTeacherInfo.do?token=' + token,  // 模糊查询老师接口
  deleteTeacherRepellentInfo: SCHEDULE_URL + '/course/rule/deleteTeacherRepellentInfo.do?token=' + token,  // 删除老师互斥信息
};

export default {
  UrlConfig
};
